//
//  JLCLInterstitialViewController.m
//  JLCLTestDemo
//
//  Created by Eren on 2022/3/29.
//

#import "JLCLInterstitialViewController.h"

@interface JLCLInterstitialViewController () <JLCLInterActionAdDelegate>

@end

@implementation JLCLInterstitialViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self show];
    UIButton *btn = [self createBtnWithTitle:@"插屏广告" withToTop:kNavBarAndStatusBarHeight +20 wihtHeight:40 withSelect:@selector(show)];
    [self.view addSubview:btn];
}

- (void)show {
    JLCLInterstitialAdData *data = [[JLCLInterstitialAdData alloc] init];
    data.delegate = self;
    data.location = 1;// 位置标识符 多个同类型广告时请准确填写位置标识 默认为1
    data.rootViewController = self;
    data.ad_id = kJLCLTestInterstitialAdID;// 广告位ID   必传
    self.aCenter = [[JLCLAdManagementCenter alloc] init];
    [self.aCenter jlcl_showInterActionAd:data];
}

- (void)jlcl_interActionVideoReady {
    NSLog(@"视频准备就绪");
}

- (void)jlcl_interstitialAdDidClick {
    NSLog(@"广告被点击");
}

- (void)jlcl_interstitialAdDidClose {
    NSLog(@"广告已关闭");
}

- (void)jlcl_interActionVideoComplete {
    NSLog(@"视频播放完成");
}

- (void)jlcl_interstitialAdRenderSuccess {
    NSLog(@"广告渲染完成");
}

- (void)jlcl_interstitialAdRenderFailWithError:(NSString *)error {
    NSLog(@"广告加载失败:%@",error);
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
